package regex;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.PipedInputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.PipedOutputStream;

public class regDemo{
    public static void main(String[] args) {
    // 要验证的字符串
    String str = "这是一个正则表达式字符串查找的示例12345，正则表达式好厉害呀45678";
    // 正则表达式规则
    String regEx = "\\d+";
    // 编译正则表达式
    Pattern pattern = Pattern.compile(regEx);
    // 忽略大小写的写法
    // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE);
    Matcher matcher = pattern.matcher(str);
    // 查找字符串中是否有匹配正则表达式的字符/字符串
    while (matcher.find()) {
        System.out.println(matcher.group());
    }
    //test our tools
    str="C1223  23 45   55  ,20; 2032   |   23  3097";
    int[] res= Graptools.get_intarray_from_GraphString(str,"C");
    if(res!=null)
    for(int t:res)System.out.println(t);
  }//end of main
}
